namespace Resharper.Abstractions.Extensions.DocumentationExtensions
{
  using JetBrains.Annotations;

  /// <summary>Defines the <see cref="DocumentedException"/> class.</summary>
  public class DocumentedException
  {
    #region Constructors and Destructors

    /// <summary>Initializes a new instance of the <see cref="DocumentedException"/> class.</summary>
    /// <param name="typeName">Name of the type.</param>
    /// <param name="description">The description.</param>
    public DocumentedException(string typeName, string description)
    {
      this.ExceptionTypeName = typeName;
      this.Description = description;
    }

    #endregion

    #region Properties

    /// <summary>
    /// Gets or sets the description.
    /// </summary>
    /// <value>The description.</value>
    public string Description { get; set; }

    /// <summary>
    /// Gets the name of the escaped exception type.
    /// </summary>
    [NotNull]
    public string EscapedExceptionTypeName
    {
      get
      {
        return this.ExceptionTypeName.Replace("<", "{").Replace(">", "}");
      }
    }

    /// <summary>
    /// Gets or sets the name of the type.
    /// </summary>
    /// <value>The name of the type.</value>
    public string ExceptionTypeName { get; set; }

    #endregion
  }
}